package work.jame.blog.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import work.jame.blog.framework.VerificationGroup;

import javax.validation.constraints.Null;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author Jame
 * @since 2023-05-26
 */
@TableName("user_rice_grains_log")
public class UserRiceGrainsLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("user_id")
    private Long userId;

    /**
     * 米粒数量
     */
    @TableField("rice_grains_number")
    private Double riceGrainsNumber;

    /**
     * 0减少 1增加
     */
    @TableField("status")
    private Boolean status;

    /**
     * 说明
     */
    @TableField("illustrate")
    private String illustrate;

    @TableField("deleted")
    @TableLogic
    @Null(message = "非法传入参数", groups = {VerificationGroup.Save.class, VerificationGroup.Update.class})
    @JsonIgnore
    private Boolean deleted;

    @TableField(value = "insert_time", fill = FieldFill.INSERT)
    @ApiModelProperty(hidden = true)
    @Null(message = "非法传入参数", groups = {VerificationGroup.Save.class, VerificationGroup.Update.class})
    private LocalDateTime insertTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(hidden = true)
    @Null(message = "非法传入参数", groups = {VerificationGroup.Save.class, VerificationGroup.Update.class})
    private LocalDateTime updateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }
    public Double getRiceGrainsNumber() {
        return riceGrainsNumber;
    }

    public void setRiceGrainsNumber(Double riceGrainsNumber) {
        this.riceGrainsNumber = riceGrainsNumber;
    }
    public Boolean getStatus() {
        return status;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }
    public String getIllustrate() {
        return illustrate;
    }

    public void setIllustrate(String illustrate) {
        this.illustrate = illustrate;
    }
    public Boolean getDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }
    public LocalDateTime getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(LocalDateTime insertTime) {
        this.insertTime = insertTime;
    }
    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "UserRiceGrainsLog{" +
            "id=" + id +
            ", userId=" + userId +
            ", riceGrainsNumber=" + riceGrainsNumber +
            ", status=" + status +
            ", illustrate=" + illustrate +
            ", deleted=" + deleted +
            ", insertTime=" + insertTime +
            ", updateTime=" + updateTime +
        "}";
    }
}
